#include "main.h"

void delay(uint16_t x) {
    uint16_t i =0 ;
    for(i=0;i<x;i++){
        ;
    }
}


// #define TIMER_RS 

void main() {
    P0 = 0;
    uint32_t TIMER_RS = 12000000/2;

    // 设置定时器0 
    PXY_WR(TIMER_BASE + 0,(TIMER_RS>>16)&0xff );
    PXY_WR(TIMER_BASE + 1,(TIMER_RS>>8)&0xff);
    PXY_WR(TIMER_BASE + 2,TIMER_RS&0xff); 
    // 使能定时器0
    PXY_WR(TIMER_BASE + 3,0x01);

    IE = 0X80 ; //开启全局中断 
    while(1) {
        // P0 = P0+1;
        delay(20000);
    }
}